<template>
  <div>
    点击 {{ count }}, 当前次数为: {{ evenOrOdd }}
  </div>
</template>

<script lang="ts" setup>
import useCounterStore from '@/stores/counter'
import {storeToRefs} from 'pinia'
// 创建store对象
const counterStore = useCounterStore()
// const {count, evenOrOdd} = counterStore   // 直接解构就失去响应式

const {count, evenOrOdd} = storeToRefs(counterStore)
</script>

<style scoped>

</style>
